<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>{$Think.config.app_name}</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="__ADMINS__/static/css/font.css">
    <link rel="stylesheet" href="__ADMINS__/static/css/weadmin.css">
    <script src="__ADMINS__/lib/layui/layui.js" charset="utf-8"></script>
    <script>
        layui.config({
            base: '__ADMINS__/static/js/'
            , version: '101100'
        }).use(['admin','liteadmin','background']);
    </script>
    <style>
        canvas{
            z-index: -1;
            position: absolute;
        }
        hr.hr15{
            opacity:0;
        }
    </style>
</head>
<body class="login-bg" style="background:#16a085;">

<div class="login" style="background-color:rgba(25,25,25,0.5)">
    <div class="message">{:config('app_name')}-管理登录</div>
    <div id="darkbannerwrap"></div>

    <form method="post" class="layui-form" action="{:url('admin/login/login')}">
        <input name="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input" value="">
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input" value="">
        <hr class="hr15">
        <input name="verify" lay-verify="required" placeholder="验证码" type="text" class="layui-input" value="">
        <hr class="hr15" >
        <img class="captcha-fresh" src="{:captcha_src()}" style="border: 1px solid;border-radius: 3px; border-color: rgb(220, 222, 224);" >
        <span class="captcha-fresh" style="text-decoration:underline ">点击验证码刷新</span>
        <hr class="hr15" >
        <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
    </form>
</div>

<script type="text/javascript">


    layui.use(['form','admin','jquery','background'], function(){
        var form = layui.form,
        admin = layui.admin,
        $ = layui.jquery;
        $('.captcha-fresh').click(function (ev) {
            $("img.captcha-fresh").attr('src','{:captcha_src()}?'+(new Date()).getTime())
        });
        $('body').particleground({
            dotColor: '#5cbdaa',
            lineColor: '#5cbdaa'
        });
        form.on('submit(login)', function (data) {
            var url = $(data.elem).attr('action');
            $.post(url,data.field).fail(function (xmr) {
                layui.layer.msg("网络错误，status = "+xmr.status,{shade: [0.3, '#393D49'],icon: data.code,time: 3000,shadeClose:true});
            }).then(function (data) {
                layui.layer.msg(data.msg,
                    {
                        shade: [0.3, '#393D49'],
                        icon: data.code,
                        time: data.wait*1000,
                        shadeClose:true
                    },
                    function () {
                        if (data.code){
                            location.href = data.url;
                        }else{
                            $("img.captcha-fresh").attr('src','{:captcha_src()}?'+(new Date()).getTime())
                        }
                    }
                );
            });
            return false;
        });
    });
</script>
<!-- 底部结束 -->
</body>
</html>